/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package radiostation;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.persistence.EntityManager;
import model.Artist;
import model.DBManager;
import model.MusicGenre;
import java.awt.Component;
import javax.swing.DefaultListCellRenderer;
import javax.swing.JList;

/**
 *
 * @author david
 */
public class EditArtistJFrame extends javax.swing.JFrame {

    /**
     * Creates new form EditArtistJFrame
     */
    public EditArtistJFrame() {
        
        em = DBManager.em;
        initComponents();
    }
    
    public EditArtistJFrame(Artist artist, boolean readOnly) {
        
        em = DBManager.em;
        this.artist = artist;
        this.readOnly = readOnly;
        
        
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {
        bindingGroup = new org.jdesktop.beansbinding.BindingGroup();

        artist1 = this.artist;
        radiostationPUEntityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("radiostationPU").createEntityManager();
        musicGenreQuery = java.beans.Beans.isDesignTime() ? null : radiostationPUEntityManager.createQuery("SELECT m FROM MusicGenre m");
        musicGenreList = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : musicGenreQuery.getResultList();
        headerPanel = new javax.swing.JPanel();
        headerLabel = new javax.swing.JLabel();
        lnameLabel = new javax.swing.JLabel();
        fnameLabel = new javax.swing.JLabel();
        artistnameLabel = new javax.swing.JLabel();
        sexLabel = new javax.swing.JLabel();
        lnameTextField = new javax.swing.JTextField();
        fnameTextField = new javax.swing.JTextField();
        artNameTextField = new javax.swing.JTextField();
        sexComboBox = new javax.swing.JComboBox();
        birthdateLabel = new javax.swing.JLabel();
        birthplaceLabel = new javax.swing.JLabel();
        genreLabel = new javax.swing.JLabel();
        birthdateTextField = new javax.swing.JTextField();
        birthplaceTextField = new javax.swing.JTextField();
        genreComboBox = new javax.swing.JComboBox();
        saveButton = new javax.swing.JButton();
        cancelButton = new javax.swing.JButton();
        sexTextField = new javax.swing.JTextField();
        genreTextField = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Διαχείριση Καλλιτέχνη");

        headerPanel.setBackground(new java.awt.Color(255, 204, 0));
        headerPanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        headerPanel.setToolTipText("null");

        headerLabel.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
        headerLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        headerLabel.setText("Διαχείριση Καλλιτέχνη");
        headerLabel.setToolTipText("null");

        javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel);
        headerPanel.setLayout(headerPanelLayout);
        headerPanelLayout.setHorizontalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerPanelLayout.createSequentialGroup()
                .addGap(275, 275, 275)
                .addComponent(headerLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        headerPanelLayout.setVerticalGroup(
            headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(headerPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(headerLabel)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        lnameLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lnameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        lnameLabel.setText("Επώνυμο :");
        lnameLabel.setToolTipText("null");

        fnameLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        fnameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        fnameLabel.setText("Όνομα :");
        fnameLabel.setToolTipText("null");

        artistnameLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        artistnameLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        artistnameLabel.setText("Καλλιτεχνικό Όνομα :");
        artistnameLabel.setToolTipText("null");

        sexLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        sexLabel.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        sexLabel.setText("Φύλο :");
        sexLabel.setToolTipText("null");

        lnameTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        lnameTextField.setToolTipText("null");

        org.jdesktop.beansbinding.Binding binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistLname}"), lnameTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        fnameTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        fnameTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistFname}"), fnameTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        artNameTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        artNameTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistArtname}"), artNameTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        sexComboBox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        sexComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Άρρεν", "Θήλυ", " " }));
        sexComboBox.setToolTipText("null");
        sexComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                sexComboBoxActionPerformed(evt);
            }
        });

        birthdateLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthdateLabel.setText("Ημερομηνία Γέννησης :");
        birthdateLabel.setToolTipText("null");

        birthplaceLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthplaceLabel.setText("Τόπος Γέννησης :");
        birthplaceLabel.setToolTipText("null");

        genreLabel.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        genreLabel.setText("Είδος Μουσικής :");
        genreLabel.setToolTipText("null");

        birthdateTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthdateTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistBirthDay}"), birthdateTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        birthplaceTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        birthplaceTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistBirthPlace}"), birthplaceTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        genreComboBox.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        genreComboBox.setToolTipText("null");
        genreComboBox.setRenderer(new DefaultListCellRenderer(){ 
            public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus){
                super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
                if (value instanceof MusicGenre){
                    MusicGenre mec = (MusicGenre)value;
                    setText(mec.getMusicGenreName());
                }
                return this;
            }
        });

        org.jdesktop.swingbinding.JComboBoxBinding jComboBoxBinding = org.jdesktop.swingbinding.SwingBindings.createJComboBoxBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, musicGenreList, genreComboBox);
        bindingGroup.addBinding(jComboBoxBinding);

        genreComboBox.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                genreComboBoxActionPerformed(evt);
            }
        });

        saveButton.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        saveButton.setText("Αποθήκευση");
        saveButton.setToolTipText("null");
        saveButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                saveButtonActionPerformed(evt);
            }
        });

        cancelButton.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        cancelButton.setText("Ακύρωση");
        cancelButton.setToolTipText("null");
        cancelButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                cancelButtonActionPerformed(evt);
            }
        });

        sexTextField.setEditable(false);
        sexTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        sexTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${artistSex}"), sexTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        genreTextField.setEditable(false);
        genreTextField.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
        genreTextField.setToolTipText("null");

        binding = org.jdesktop.beansbinding.Bindings.createAutoBinding(org.jdesktop.beansbinding.AutoBinding.UpdateStrategy.READ_WRITE, artist1, org.jdesktop.beansbinding.ELProperty.create("${musicGenreId.musicGenreName}"), genreTextField, org.jdesktop.beansbinding.BeanProperty.create("text"));
        bindingGroup.addBinding(binding);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(headerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(lnameLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 70, javax.swing.GroupLayout.PREFERRED_SIZE)
                                            .addComponent(fnameLabel))
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                            .addComponent(lnameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 235, Short.MAX_VALUE)
                                            .addComponent(fnameTextField)))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(artistnameLabel)
                                        .addGap(26, 26, 26)
                                        .addComponent(artNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(49, 49, 49)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(birthdateLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(birthdateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(layout.createSequentialGroup()
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(birthplaceLabel)
                                            .addComponent(genreLabel))
                                        .addGap(18, 18, 18)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(birthplaceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 184, javax.swing.GroupLayout.PREFERRED_SIZE)
                                                .addGap(0, 35, Short.MAX_VALUE))
                                            .addGroup(layout.createSequentialGroup()
                                                .addComponent(genreTextField)
                                                .addGap(18, 18, 18)
                                                .addComponent(genreComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE))))))
                            .addGroup(layout.createSequentialGroup()
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(saveButton, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(sexLabel)
                                        .addGap(18, 18, 18)
                                        .addComponent(sexTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                                .addGap(18, 18, 18)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(sexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, 112, javax.swing.GroupLayout.PREFERRED_SIZE))))
                        .addGap(31, 31, 31)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(lnameLabel)
                    .addComponent(lnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(birthdateLabel)
                    .addComponent(birthdateTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(fnameLabel)
                    .addComponent(fnameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(birthplaceLabel)
                    .addComponent(birthplaceTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(22, 22, 22)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(artistnameLabel)
                    .addComponent(artNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(genreLabel)
                    .addComponent(genreComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(genreTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(32, 32, 32)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(sexLabel)
                    .addComponent(sexComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(sexTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 42, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(saveButton)
                    .addComponent(cancelButton))
                .addContainerGap())
        );

        bindingGroup.bind();

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void closeMe(boolean exitAndSave)
    {
        MyWindowEvent we = new MyWindowEvent(this, WindowEvent.WINDOW_CLOSED, exitAndSave);
        for (WindowListener l : this.getWindowListeners())
        {
            l.windowClosed(we);
            
        }
        this.setVisible(false);
    }
    
    private void saveButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveButtonActionPerformed
        // TODO add your handling code here:
        
        closeMe(true);
    }//GEN-LAST:event_saveButtonActionPerformed

    private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
        // TODO add your handling code here:
        
        closeMe(false);
    }//GEN-LAST:event_cancelButtonActionPerformed

    private void sexComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_sexComboBoxActionPerformed
        // TODO add your handling code here:
        sexTextField.setText(sexComboBox.getSelectedItem().toString());
    }//GEN-LAST:event_sexComboBoxActionPerformed

    private void genreComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_genreComboBoxActionPerformed
        // TODO add your handling code here:
        if (genreComboBox.isFocusOwner())
        {
            MusicGenre mg = (MusicGenre)genreComboBox.getSelectedItem();
            artist.setMusicGenreId(mg);
        }
        
        
        
    }//GEN-LAST:event_genreComboBoxActionPerformed

    /**
     * @param args the command line arguments
     */
    
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(EditArtistJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(EditArtistJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(EditArtistJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(EditArtistJFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new EditArtistJFrame().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField artNameTextField;
    private model.Artist artist1;
    private javax.swing.JLabel artistnameLabel;
    private javax.swing.JLabel birthdateLabel;
    private javax.swing.JTextField birthdateTextField;
    private javax.swing.JLabel birthplaceLabel;
    private javax.swing.JTextField birthplaceTextField;
    private javax.swing.JButton cancelButton;
    private javax.swing.JLabel fnameLabel;
    private javax.swing.JTextField fnameTextField;
    private javax.swing.JComboBox genreComboBox;
    private javax.swing.JLabel genreLabel;
    private javax.swing.JTextField genreTextField;
    private javax.swing.JLabel headerLabel;
    private javax.swing.JPanel headerPanel;
    private javax.swing.JLabel lnameLabel;
    private javax.swing.JTextField lnameTextField;
    private java.util.List<model.MusicGenre> musicGenreList;
    private javax.persistence.Query musicGenreQuery;
    private javax.persistence.EntityManager radiostationPUEntityManager;
    private javax.swing.JButton saveButton;
    private javax.swing.JComboBox sexComboBox;
    private javax.swing.JLabel sexLabel;
    private javax.swing.JTextField sexTextField;
    private org.jdesktop.beansbinding.BindingGroup bindingGroup;
    // End of variables declaration//GEN-END:variables

    private Artist artist;
    EntityManager em;
    private boolean readOnly;
    
}

